package com.ccrc.lang;

import java.io.Serializable;
import java.util.List;

import com.google.common.collect.Lists;

/**
 * 目前只用于jQuery Easyui 分页
 * @author Jalen
 *
 */
public final class Pager implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 6971052779261991417L;
	
	private Integer pageSize;// 每页显示的记录数
	
	private Integer curPage;// 当前第几页
	
	private Long total = 0L;
	
	private List<?> rows = Lists.newArrayList();
	
	public Pager() {
		
	}

	public Pager(Integer pageSize, Integer curPage) {
		super();
		this.pageSize = pageSize;
		this.curPage = curPage;
	}

	public Integer getPageSize() {
		return pageSize;
	}

	public void setPageSize(Integer pageSize) {
		this.pageSize = pageSize;
	}

	public Integer getCurPage() {
		return (curPage - 1) * pageSize;
	}

	public void setCurPage(Integer curPage) {
		this.curPage = curPage;
	}

	public Long getTotal() {
		return total;
	}

	public void setTotal(Long total) {
		this.total = total;
	}

	public List<?> getRows() {
		return rows;
	}

	public void setRows(List<?> rows) {
		this.rows = rows;
	}

}
